﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt;

    public class wf_action_Map : ClassMapping<wf_action>
    {
        public wf_action_Map()
        {
            //映射ID
            Id(x => x.act_id, map => map.Length(40));

            Property(x => x.is_valid);
            Property(x => x.create_date);

            Property(x => x.act_date);
            Property(x => x.act_do_flag);
            Property(x => x.act_idx);
            Property(x => x.act_result, map=>map.Length(400));
            Property(x => x.act_result_describe, map => map.Length(4000));
            Property(x => x.act_result_flag);
            Property(x => x.act_title, map => map.Length(200));
            Property(x => x.act_user_name, map => map.Length(40));

            //所属审批节点
            ManyToOne(x => x.node, map =>
            {
                map.Column(wf_action.Columns.node_id);
            });

            //所属用户
            ManyToOne(x => x.act_user, map =>
            {
                map.Column(wf_action.Columns.act_user_id);
            });

            Table(wf_action.TableName);

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
